package springboot_cae_thymeleaf.dao;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import springboot_cae_thymeleaf.entity.CaeEntity;

@Mapper
public interface CaeDao {
	@Select("select * from caedata")
	List<CaeEntity> select(); 
	@Select("select * from caedata where id=#{id}")
	CaeEntity selectBy(int id);
	@Update("update caedata set software=#{software},ip=#{ip},server=#{server},address=#{address},port=#{port},license=#{license},date=#{date} where id=#{id}")
	void update(CaeEntity caeEntity);
	@Insert("insert into caedata(id,software,ip,server,address,port,license,date) values(#{id},#{software},#{ip},#{server},#{address},#{port},#{license},#{date})")
	void add(CaeEntity caetEntity);
	@Delete("delete from caedata where id=#{id}")
	void delete(int id);
}
